﻿<%@ Page Language="C#" MasterPageFile="~/SubForm.Master" AutoEventWireup="true" Codebehind="ReportDownload.aspx.cs"
    Inherits="PreContractWeb.Administration.ReportDownload" Title="ReportDownload Page" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="../UserControl/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divError" runat="server" visible="false">
    </div>
    <div id="divConnect" runat="server">
        <iframe id="ifrmRpt" src="" height="0" width="0" frameborder="0" visible="true"></iframe>
        <div style="text-align: center">
             <asp:ScriptManager id="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel id="UpdatePanel1" runat="server">
                <contenttemplate>

</contenttemplate>
            </asp:UpdatePanel>
            <table cellspacing="0" cellpadding="0" width="95%" border="0">
                <tbody>
                    <tr>
                        <td valign="middle" align="center" width="100%" height="100%">
                            <br />
                            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                <tbody>
                                    <tr>
                                        <td class="panel_header">
                                            <!--标题-->
                                            查询条件(Search Condition)<!--标题--></td>
                                        <td valign="top" width="5" background="../Images/BG-Border-Right.png" rowspan="2">
                                            <img src="../Images/BG-Border-RT.png" border="0" /></td>
                                    </tr>
                                    <tr>
                                        <td class="panel_body">
                                            <!--Panel Body-->
                                            <table style="width: 100%">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <table style="width: 95%; height: 100%">
                                                                <tbody>
                                                                    <tr>
                                                                        <td style="width: 10%; text-align: left" valign="middle" align="left">
                                                                            &nbsp;报表类型:<br />
                                                                            &nbsp;Report Type:</td>
                                                                        <td valign="middle" align="left">
                                                                            <asp:DropDownList ID="ConditionDropDownList" runat="server">
                                                                            </asp:DropDownList></td>
                                                                        <td valign="middle" align="left">
                                                                            报表时间:<br />
                                                                            Report Date:</td>
                                                                        <td valign="middle" align="left">
                                                                            <asp:TextBox ID="TimeTextBox" runat="server" allowempty="true" checkmaster="checkDate"
                                                                                CssClass="cssPopdate" Width="150px" IconID="DateIcon01"></asp:TextBox>&nbsp;<img
                                                                                    id="DateIcon01" class="DateIcon" src="../Images/calendar_18.gif" /></td>
                                                                        <td align="right" valign="middle">
                                                                            &nbsp;<asp:Button ID="SearchButton" OnClick="SearchButton_Click" runat="server" CssClass="bgButton"
                                                                                Text="查询(Search)" isvalidate="true"></asp:Button>&nbsp;
                                                                            <asp:Button ID="DeleteButton" OnClick="DeleteButton_Click" runat="server" CssClass="bgButton" autopostback="false" 
                                                                                Text="删除(Delete)"></asp:Button></td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div style="overflow: auto" id="divReport" runat="server">
                                                                <table style="height: 100%" cellspacing="0" cellpadding="0" width="95%" border="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td style="border-top: #bbbbbb 1px dashed; height: 100%" valign="top" align="cneter">
                                                                                <br />
                                                                                <div>
                                                                                    <asp:GridView ID="gvReport" runat="server" Width="100%" PageSize="20" OnRowDataBound="gvReport_RowDataBound"
                                                                                        DataKeyNames="ReportID" AutoGenerateColumns="False" EmptyDataText="无此类型报表">
                                                                                        <PagerSettings Visible="False"></PagerSettings>
                                                                                        <EmptyDataTemplate>
                                                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                    <tr>
                                                                        <td class="panel_header">
                                                                            <!--标题-->
                                                                            没有数据(No Data).
                                                                            <!--标题-->
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </EmptyDataTemplate>
                                                                                        <Columns>
                                                                                            <asp:TemplateField>
                                                                                                <HeaderTemplate>
                                                                                                    <input type="checkbox" id="chkAll" name="chkAll" onclick="javascript: return CheckAll(this.checked, this.id);" />
                                                                                                </HeaderTemplate>
                                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                                <HeaderStyle Wrap="False"></HeaderStyle>
                                                                                                <ItemTemplate>
                                                                                                    <asp:CheckBox ID="chkSelect" runat="server" onClick="javascript: return CheckAll(this.checked, this.id);" />
                                                                                                </ItemTemplate>
                                                                                            </asp:TemplateField>
                                                                                            <asp:BoundField DataField="ReportType" HeaderText="报表类型&lt;br/&gt;ReportType" HtmlEncode="False">
                                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                            </asp:BoundField>
                                                                                            <asp:BoundField DataFormatString="{0:yyyy-MM-dd}" DataField="ReportDate" HeaderText="报表时间&lt;br/&gt;Reportdate"
                                                                                                HtmlEncode="False">
                                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                            </asp:BoundField>
                                                                                            <asp:TemplateField HeaderText="下载&lt;br/&gt;Download">
                                                                                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                                                                <ItemTemplate>
                                                                                                    <asp:ImageButton ID="imgedit" runat="server" ImageUrl="../images/COMEDIT.GIF" ToolTip="下载" />
                                                                                                </ItemTemplate>
                                                                                            </asp:TemplateField>
                                                                                        </Columns>
                                                                                        <RowStyle Height="20px" CssClass="table_row_1"></RowStyle>
                                                                                        <SelectedRowStyle CssClass="SelectedRow"></SelectedRowStyle>
                                                                                        <HeaderStyle CssClass="table_header"></HeaderStyle>
                                                                                        <AlternatingRowStyle CssClass="table_row_2"></AlternatingRowStyle>
                                                                                    </asp:GridView>
                                                                                    &nbsp;
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <!---->
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" background="../Images/BG-Border-Bottom.png" height="5">
                                            <img src="../Images/BG-Border-LB.png" border="0" /></td>
                                        <td width="5" background="../Images/BG-Border-RB.png" height="5">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <script language="javascript">
    window.attachEvent("onresize",resizeFunc1); 
    resizeFunc1();
    function resizeFunc1()
    {
        var parentWin=window.parent;
        if (parentWin!=null)
        {
            var ofrm=parentWin.document.getElementById("main");
            if (ofrm!=null)
            {
            
                var sHeight=ofrm.document.body.offsetHeight;
                var sWidth=ofrm.document.body.offsetWidth;
             
                var divReport=document.getElementById("ctl00_ContentPlaceHolder1_divReport");
                if (divReport!=null)
                {
                    divReport.style.width=sWidth-290;
                    divReport.style.height=sHeight-240;
                }
            }
        }
    }

    function OnRptDelete()
    {
        var chkList=document.documentElement.getElementsByTagName("INPUT");
        var chk;
        var n=0;
        

        for (var i=0;i<chkList.length;i++)
        {
            chk=chkList[i];
            if (chk.type=="checkbox" && chk.id!=="chkAll")
            {
                if (chk.checked)
                    n++;
            }
            
        }
        if (n==0)
            alert("请选择至少一项!\n Please select at least one item!");
        else
        {
            if (confirm("确认删除所选项吗？\nAre you sure to delete selected item(s)?"))
            {
                var btn=document.getElementById("ctl00_ContentPlaceHolder1_DeleteButton");
                btn.removeAttribute("autopostback");
            }
        }
    }
    </script>

</asp:Content>
